package com.tom.demo.common.enumeration;

import lombok.Getter;

public class FileUploadEnum {

    /**
     * 头像上传格式校验枚举
     */
    @Getter
    public enum AvatarEnum {
        JPEG("image/jpeg"),
        PNG("image/png"),
        WEBP("image/webp");

        private final String mimeType;

        AvatarEnum(String mimeType) {
            this.mimeType = mimeType;
        }

        public static boolean isValidFormat(String mimeType) {
            for (AvatarEnum format : AvatarEnum.values()) {
                if (format.getMimeType().equals(mimeType)) {
                    return true;
                }
            }
            return false;
        }
    }



}
